<?php
class Con_reg extends Acan{
	public $defaultAct='index';
	function __construct($ainfo=null){
		parent::__construct($ainfo=null);
		$this->model = Afun_db()->model(Acan_table_user);
	}
	function Act_index(){
		echo 'no';
		return;
	}
	function Act_client(){
		$data['username'] = $_REQUEST['username'];
		$data['password'] = $_REQUEST['password'];
		$data['mail'] = $_REQUEST['mail'];
		$rs['msg'] = "none";
		$rs['status'] = 0;
		if(!empty($data['username'])){
			$rs['uid'] = Afunc_auth()->user_add($data);
			if($rs['uid']>0){
				$rs['status'] = 1;
				$rs['msg'] = "注册成功";
			}else{
				$rs['status'] = 2;
				$rs['msg'] = "注册失败";
			}
			print Ajson_encode($rs);
		}
		Afun_json($rs);
		return;
	}
}
?>